﻿using System;
using System.Collections.Generic;
using Engine;
using Engine.Attributes;
using NUnit.Framework;

namespace Engine.Components.Arithmetic
{
	public class IntegerAdder: UserCodedComponent
	{
        public readonly InPort<int> Op1;
        public readonly InPort<int> Op2;
        public readonly OutPort<int> Result;

        public IntegerAdder()
        {
            Op1 = new InPort<int>(this.Run);
            Op2 = new InPort<int>(this.Run);
            Result = new OutPort<int>();
        }

        private void Run()
        {
            Result.Value = Op1.Value + Op2.Value;
		}
	}
}
